* Wealth index calculation. Guillermo Rojas, 05/02/2019. Turkey DHS 2018. cd 'C:\TR71\Wealth'. include file='wealth_assets.sps'. execute. set tvars=both. * Macro definitions to perform some recoding automatically. * Note: Do not use an asterisk in front of a macro name to try to comment it out - it will run any way because of the way the macros are expanded. * Delete the line instead or change the spelling of the macro in the comment. * Do not use the names of macros in comments - they will also be expanded too, and likely will fail. *{Create binary variables based on condition and give label }. define dichotomize( !positional !enclose('(',')') / !positional !tokens(1) / !positional !tokens(1) ) compute !2=0. if (!1) !2=1. variable labels !2 !3. value labels !2 0 'No' 1 'Yes'. formats !2 (f1.0). !enddefine. *(Separate shared toilets from non-shared toilets). define shared_fac( !positional !tokens(1) / !positional !tokens(1) / !positional !tokens(1) ). compute !2 = 0. do if (QH209=2). + if (!1=1) !2 = 1. + compute !1 = 0. end if. variable labels !2 !3. value labels !2 0 'No' 1 'Yes'. formats !2 (f1.0). !enddefine. *{Reset missing values to 'does not have', change 2 code to 0}. define no2zero( !positional !tokens(1) ) if (missing(!1) | !1<>1) !1=0. value labels !1 0 'No' 1 'Yes'. !enddefine. *{Construct Variables}. * House ownership. dichotomize (QH201=1) QH201_1 "House ownership: Owned by a HH member". dichotomize (QH201=2) QH201_2 "House ownership: Rented". dichotomize (QH201=3) QH201_3 "House ownership: Lodging". dichotomize (QH201=4) QH201_4 "House ownership: No rent paid". dichotomize (QH201=6) QH201_6 "House ownership: Other". * Anyone owns another house. no2zero QH202. * Source of drinking water. dichotomize (QH203=11) QH203_11 "Source of drinking water: Piped into dwelling". dichotomize (QH203=12) QH203_12 "Source of drinking water: Piped to yard/plot". dichotomize (QH203=13) QH203_13 "Source of drinking water: Public tap/standpipe". dichotomize (QH203=21) QH203_21 "Source of drinking water: Tube well or borehole". dichotomize (QH203=31) QH203_31 "Source of drinking water: Protected well". dichotomize (QH203=32) QH203_32 "Source of drinking water: Unprotected well". dichotomize (QH203=41) QH203_41 "Source of drinking water: Protected spring". dichotomize (QH203=42) QH203_42 "Source of drinking water: Unprotected spring". *ichotomize (QH203=51) QH203_51 "Source of drinking water: Rainwater". dichotomize (QH203=61 | QH203=62) QH203_61 "Source of drinking water: Tanker truck/water station/cart with tank". *ichotomize (QH203=62) QH203_62 "Source of drinking water: Cart with small tank". dichotomize (QH203=81) QH203_81 "Source of drinking water: Surface water stream/lake/pond". dichotomize (QH203=91) QH203_91 "Source of drinking water: Bottled/demijohn/pet water". dichotomize (QH203=96) QH203_96 "Source of drinking water: Other". * Type of toilet facility. dichotomize (QH208=1) QH208_1 "Type of toilet facility: Connected to sewerage". dichotomize (QH208=2) QH208_2 "Type of toilet facility: Open pit". dichotomize (QH208=3) QH208_3 "Type of toilet facility: Closed pit". dichotomize (QH208=6) QH208_6 "Type of toilet facility: Other". shared_fac QH208_1 QH208_1_sh "Type of toilet facility: Connected to sewerage - shared". shared_fac QH208_2 QH208_2_sh "Type of toilet facility: Open pit - shared". shared_fac QH208_3 QH208_3_sh "Type of toilet facility: Closed pit - shared". *hared_fac QH208_6 QH208_6_sh "Type of toilet facility: Other - shared". * Heating facility. dichotomize (QH210=11) QH210_11 "Heating facility: Central heating-natural gas". *ichotomize (QH210=12) QH210_12 "Heating facility: Central heating-diesel oil/gas oil". dichotomize (QH210=13 | QH210=12) QH210_13 "Heating facility: Central heating-wood/coal + diesel". dichotomize (QH210=14) QH210_14 "Heating facility: Central heating-other". dichotomize (QH210=21) QH210_21 "Heating facility: Flat heating-natural gas". dichotomize (QH210=22) QH210_22 "Heating facility: Flat heating-diesel oil/gas oil". dichotomize (QH210=23) QH210_23 "Heating facility: Flat heating-other". dichotomize (QH210=31) QH210_31 "Heating facility: Stove-natural gas". *ichotomize (QH210=32) QH210_32 "Heating facility: Stove-diesel oil/gas oil". dichotomize (QH210=33 | QH210=32) QH210_33 "Heating facility: Stove-wood/coal + stove diesel". dichotomize (QH210=34) QH210_34 "Heating facility: Stove-dried cow dung". dichotomize (QH210=35) QH210_35 "Heating facility: Stove-other". dichotomize (QH210=40) QH210_40 "Heating facility: Electric heater". dichotomize (QH210=41) QH210_41 "Heating facility: Air conditioner". dichotomize (QH210=96) QH210_96 "Heating facility: Other". * Main material of floor. dichotomize (QH214=11) QH214_11 "Main material of floor: Earth, sand". dichotomize (QH214=21) QH214_21 "Main material of floor: Wood planks". dichotomize (QH214=31) QH214_31 "Main material of floor: Parquet, polished, laminated,wood". dichotomize (QH214=32) QH214_32 "Main material of floor: Tile". dichotomize (QH214=34) QH214_34 "Main material of floor: Cement". dichotomize (QH214=35) QH214_35 "Main material of floor: Carpet". dichotomize (QH214=36) QH214_36 "Main material of floor: Vinyl covering". dichotomize (QH214=37) QH214_37 "Main material of floor: Mozaic". dichotomize (QH214=38) QH214_38 "Main material of floor: Laminate". dichotomize (QH214=96) QH214_96 "Main material of floor: Other". * Deep freezer. no2zero QH215A. * Gas/electric oven. no2zero QH215B. * Microwave oven. no2zero QH215C. * Dishwasher. no2zero QH215D. * Garbage dispenser. no2zero QH215E. * Washing maachine. no2zero QH215F. * Drying machine. no2zero QH215G. * Iron. no2zero QH215H. * Vacuum cleaner. no2zero QH215I. * LCD-plasma TV. no2zero QH215J. * Home theater. no2zero QH215K. * Tea/coffee machine. no2zero QH215L. * Kettle. no2zero QH215M. * Generator. no2zero QH215N. * Blender. no2zero QH215O. * Paid TV services. no2zero QH215P. * Satellite TV. no2zero QH215Q. * Computer. no2zero QH215R. * Internet. no2zero QH215S. * Air conditioner. no2zero QH215T. * Private car. no2zero QH215U. * Commercial vehicle. no2zero QH215V. * Tractor. no2zero QH215W. * Private health security. no2zero QH216. * Type of house. dichotomize (QH218=1) QH218_1 "Type of house: Adobe house". dichotomize (QH218=2) QH218_2 "Type of house: Brick house". dichotomize (QH218=3) QH218_3 "Type of house: Stone house". dichotomize (QH218=4) QH218_4 "Type of house: Detached house-reinforced concrete". dichotomize (QH218=5) QH218_5 "Type of house: Apartmant-reinforced concrete". *ichotomize (QH218=6) QH218_6 "Type of house: Tent". *ichotomize (QH218=7) QH218_7 "Type of house: Container". dichotomize (QH218=96 | QH218=6 | QH218=7) QH218_96 "Type of house: Other + other + container". *{Members per sleeping room}. if (hhusual=0) hhusual=hhslept. if (QH212>0) memsleep=trunc(hhusual/QH212). if (QH212=0) memsleep=hhusual. if (missing(QH212) or QH212>=99 or memsleep>=98) memsleep=99. variable labels memsleep 'Number of members per sleeping room'. value labels memsleep 0 'Less than 1 per room'. formats memsleep (f2.0). missing values memsleep (99). * Compute urban and rural variables coded (1/0) for filters later. compute urban=(QHTYPE = 1). compute rural=(QHTYPE = 2). variable labels urban 'Urban' / rural 'Rural'. value labels urban 1 'Urban' / rural 1 'Rural'. formats urban rural (f1.0). execute. * Check on indicator variable creation. frequencies variables=QHTYPE to domestic. * Toilet facility by shared/not shared. crosstabs /tables=QH208 by QH209. * Land area by units - if there are separate units - need to convert them to one unit. *crosstabs /tables=ZH120N by ZH120U. frequencies variables= QH201_1 QH201_2 QH201_3 QH201_4 QH201_6 QH202 QH203_11 QH203_12 QH203_13 QH203_21 QH203_31 QH203_32 QH203_41 QH203_42 QH203_61 QH203_81 QH203_91 QH203_96 QH208_1 QH208_2 QH208_3 QH208_6 QH208_1_sh QH208_2_sh QH208_3_sh QH210_11 QH210_13 QH210_14 QH210_21 QH210_22 QH210_23 QH210_31 QH210_33 QH210_34 QH210_35 QH210_40 QH210_41 QH210_96 QH214_11 QH214_21 QH214_31 QH214_32 QH214_34 QH214_35 QH214_36 QH214_37 QH214_38 QH214_96 QH215A QH215B QH215C QH215D QH215E QH215F QH215G QH215H QH215I QH215J QH215K QH215L QH215M QH215N QH215O QH215P QH215Q QH215R QH215S QH215T QH215U QH215V QH215W QH216 QH218_1 QH218_2 QH218_3 QH218_4 QH218_5 QH218_96 NOTOILET DOMESTIC LAND memsleep . * Turn off weights before all factor analysis. weight off. * Name the dataset window for the HH data for use later. dataset name assets. save outfile='assets.sav'. *** Test Factor Analysis. filter off. execute. *Variables removed totally from PCA * QH203_51 QH203_62 QH208_6_sh QH210_12 QH201_32 QH218_6 QH218_7 factor /variables QH201_1 QH201_2 QH201_3 QH201_4 QH201_6 QH202 QH203_11 QH203_12 QH203_13 QH203_21 QH203_31 QH203_32 QH203_41 QH203_42 QH203_61 QH203_81 QH203_91 QH203_96 QH208_1 QH208_2 QH208_3 QH208_6 QH208_1_sh QH208_2_sh QH208_3_sh QH210_11 QH210_13 QH210_14 QH210_21 QH210_22 QH210_23 QH210_31 QH210_33 QH210_34 QH210_35 QH210_40 QH210_41 QH210_96 QH214_11 QH214_21 QH214_31 QH214_32 QH214_34 QH214_35 QH214_36 QH214_37 QH214_38 QH214_96 QH215A QH215B QH215C QH215D QH215E QH215F QH215G QH215H QH215I QH215J QH215K QH215L QH215M QH215N QH215O QH215P QH215Q QH215R QH215S QH215T QH215U QH215V QH215W QH216 QH218_1 QH218_2 QH218_3 QH218_4 QH218_5 QH218_96 NOTOILET DOMESTIC LAND memsleep /missing meansub /analysis QH201_1 QH201_2 QH201_3 QH201_4 QH201_6 QH202 QH203_11 QH203_12 QH203_13 QH203_21 QH203_31 QH203_32 QH203_41 QH203_42 QH203_61 QH203_81 QH203_91 QH203_96 QH208_1 QH208_2 QH208_3 QH208_6 QH208_1_sh QH208_2_sh QH208_3_sh QH210_11 QH210_13 QH210_14 QH210_21 QH210_22 QH210_23 QH210_31 QH210_33 QH210_34 QH210_35 QH210_40 QH210_41 QH210_96 QH214_11 QH214_21 QH214_31 QH214_32 QH214_34 QH214_35 QH214_36 QH214_37 QH214_38 QH214_96 QH215A QH215B QH215C QH215D QH215E QH215F QH215G QH215H QH215I QH215J QH215K QH215L QH215M QH215N QH215O QH215P QH215Q QH215R QH215S QH215T QH215U QH215V QH215W QH216 QH218_1 QH218_2 QH218_3 QH218_4 QH218_5 QH218_96 NOTOILET DOMESTIC LAND memsleep /print univariate initial extraction fscore /criteria factors(1) iterate(25) /extraction pc /rotation norotate /method=correlation. *** Common Factor analysis ***. ** Removed area-specific variables **. ** Agricultural animal variables excluded ** Land area excluded ** Any others ?. *** Common Factor Analysis. filter off. execute. factor /variables QH201_1 QH201_2 QH201_3 QH201_4 QH201_6 QH202 QH203_11 QH203_12 QH203_13 QH203_21 QH203_31 QH203_32 QH203_41 QH203_42 QH203_61 QH203_81 QH203_91 QH203_96 QH208_1 QH208_2 QH208_3 QH208_6 QH208_1_sh QH208_2_sh QH208_3_sh QH210_11 QH210_13 QH210_14 QH210_21 QH210_22 QH210_23 QH210_31 QH210_33 QH210_34 QH210_35 QH210_40 QH210_41 QH210_96 QH214_11 QH214_21 QH214_31 QH214_32 QH214_34 QH214_35 QH214_36 QH214_37 QH214_38 QH214_96 QH215A QH215B QH215C QH215D QH215E QH215F QH215G QH215H QH215I QH215J QH215K QH215L QH215M QH215N QH215O QH215P QH215Q QH215R QH215S QH215T QH215U QH215V QH215W QH216 QH218_1 QH218_2 QH218_3 QH218_4 QH218_5 QH218_96 NOTOILET DOMESTIC LAND memsleep /missing meansub /analysis QH201_1 QH201_2 QH201_3 QH201_4 QH201_6 QH202 QH203_11 QH203_12 QH203_13 QH203_21 QH203_31 QH203_32 QH203_41 QH203_42 QH203_61 QH203_81 QH203_91 QH203_96 QH208_1 QH208_2 QH208_3 QH208_6 QH208_1_sh QH208_2_sh QH208_3_sh QH210_11 QH210_13 QH210_14 QH210_21 QH210_22 QH210_23 QH210_31 QH210_33 QH210_34 QH210_35 QH210_40 QH210_41 QH210_96 QH214_11 QH214_21 QH214_31 QH214_32 QH214_34 QH214_35 QH214_36 QH214_37 QH214_38 QH214_96 QH215A QH215B QH215C QH215D QH215E QH215F QH215G QH215H QH215I QH215J QH215K QH215L QH215M QH215N QH215O QH215P QH215Q QH215R QH215S QH215T QH215U QH215V QH215W QH216 QH218_1 QH218_2 QH218_3 QH218_4 QH218_5 QH218_96 NOTOILET DOMESTIC LAND memsleep /print univariate initial extraction fscore /criteria factors(1) iterate(25) /extraction pc /rotation norotate /save reg(ALL com) /method=correlation. *** Urban Factor Analysis. filter off. filter by urban. execute. factor /variables QH201_1 QH201_2 QH201_3 QH201_4 QH201_6 QH202 QH203_11 QH203_12 QH203_13 QH203_21 QH203_31 QH203_32 QH203_41 QH203_42 QH203_61 QH203_81 QH203_91 QH203_96 QH208_1 QH208_2 QH208_3 QH208_6 QH208_1_sh QH208_2_sh QH208_3_sh QH210_11 QH210_13 QH210_14 QH210_21 QH210_22 QH210_23 QH210_31 QH210_33 QH210_34 QH210_35 QH210_40 QH210_41 QH210_96 QH214_11 QH214_21 QH214_31 QH214_32 QH214_34 QH214_35 QH214_36 QH214_37 QH214_38 QH214_96 QH215A QH215B QH215C QH215D QH215E QH215F QH215G QH215H QH215I QH215J QH215K QH215L QH215M QH215N QH215O QH215P QH215Q QH215R QH215S QH215T QH215U QH215V QH215W QH216 QH218_1 QH218_2 QH218_3 QH218_4 QH218_5 QH218_96 NOTOILET DOMESTIC LAND memsleep /missing meansub /analysis QH201_1 QH201_2 QH201_3 QH201_4 QH201_6 QH202 QH203_11 QH203_12 QH203_13 QH203_21 QH203_31 QH203_32 QH203_41 QH203_42 QH203_61 QH203_81 QH203_91 QH203_96 QH208_1 QH208_2 QH208_3 QH208_6 QH208_1_sh QH208_2_sh QH208_3_sh QH210_11 QH210_13 QH210_14 QH210_21 QH210_22 QH210_23 QH210_31 QH210_33 QH210_34 QH210_35 QH210_40 QH210_41 QH210_96 QH214_11 QH214_21 QH214_31 QH214_32 QH214_34 QH214_35 QH214_36 QH214_37 QH214_38 QH214_96 QH215A QH215B QH215C QH215D QH215E QH215F QH215G QH215H QH215I QH215J QH215K QH215L QH215M QH215N QH215O QH215P QH215Q QH215R QH215S QH215T QH215U QH215V QH215W QH216 QH218_1 QH218_2 QH218_3 QH218_4 QH218_5 QH218_96 NOTOILET DOMESTIC LAND memsleep /print univariate initial extraction fscore /criteria factors(1) iterate(25) /extraction pc /rotation norotate /save reg(ALL urb) /method=correlation. *** Rural Factor Analysis. filter off. filter by rural. execute. factor /variables QH201_1 QH201_2 QH201_3 QH201_4 QH201_6 QH202 QH203_11 QH203_12 QH203_13 QH203_21 QH203_31 QH203_32 QH203_41 QH203_42 QH203_61 QH203_81 QH203_91 QH203_96 QH208_1 QH208_2 QH208_3 QH208_6 QH208_1_sh QH208_2_sh QH208_3_sh QH210_11 QH210_13 QH210_14 QH210_21 QH210_22 QH210_23 QH210_31 QH210_33 QH210_34 QH210_35 QH210_40 QH210_41 QH210_96 QH214_11 QH214_21 QH214_31 QH214_32 QH214_34 QH214_35 QH214_36 QH214_37 QH214_38 QH214_96 QH215A QH215B QH215C QH215D QH215E QH215F QH215G QH215H QH215I QH215J QH215K QH215L QH215M QH215N QH215O QH215P QH215Q QH215R QH215S QH215T QH215U QH215V QH215W QH216 QH218_1 QH218_2 QH218_3 QH218_4 QH218_5 QH218_96 NOTOILET DOMESTIC LAND memsleep /missing meansub /analysis QH201_1 QH201_2 QH201_3 QH201_4 QH201_6 QH202 QH203_11 QH203_12 QH203_13 QH203_21 QH203_31 QH203_32 QH203_41 QH203_42 QH203_61 QH203_81 QH203_91 QH203_96 QH208_1 QH208_2 QH208_3 QH208_6 QH208_1_sh QH208_2_sh QH208_3_sh QH210_11 QH210_13 QH210_14 QH210_21 QH210_22 QH210_23 QH210_31 QH210_33 QH210_34 QH210_35 QH210_40 QH210_41 QH210_96 QH214_11 QH214_21 QH214_31 QH214_32 QH214_34 QH214_35 QH214_36 QH214_37 QH214_38 QH214_96 QH215A QH215B QH215C QH215D QH215E QH215F QH215G QH215H QH215I QH215J QH215K QH215L QH215M QH215N QH215O QH215P QH215Q QH215R QH215S QH215T QH215U QH215V QH215W QH216 QH218_1 QH218_2 QH218_3 QH218_4 QH218_5 QH218_96 NOTOILET DOMESTIC LAND memsleep /print univariate initial extraction fscore /criteria factors(1) iterate(25) /extraction pc /rotation norotate /save reg(ALL rur) /method=correlation. * Label the created score variables. rename variables (com1 urb1 rur1=comscore urbscore rurscore). variable labels comscore 'Common wealth score' /urbscore 'Urban wealth score' /rurscore 'Rural wealth score'. * Add a variable used for linking later. filter off. string rowtype_ (A8). compute rowtype_ = 'EST'. * Calculate regressions. ** Area=urban. filter off. filter by urban. execute. * Declare a dataset to be written to in the regression. dataset declare urbancorv. * Run regression of comscore with urbscore. regression /missing listwise /statistics coeff outs R anova /criteria=pin(.05) pout(.10) /noorigin /dependent comscore /method=enter urbscore /outfile=corv(urbancorv). * Activate file of output from regression. dataset activate urbancorv. * Drop all rows of output except the coefficients. select if (rowtype_ = 'EST'). execute. * Delete unnecessary variables before merging. delete variables DEPVAR_ VARNAME_. * Rename variables containing the constant and the coefficient. rename variables CONST_=urbconst urbscore=urbcoeff. * Re-activate the main household data. dataset activate assets. * merge the coefficients. match files /file = * /table = urbancorv /by ROWTYPE_. execute. * Calculate regressions. ** Area=rural. filter off. filter by rural. execute. * Declare a dataset to be written to in the regression. dataset declare ruralcorv. * Run regression of comscore with rurscore. regression /missing listwise /statistics coeff outs R anova /criteria=pin(.05) pout(.10) /noorigin /dependent comscore /method=enter rurscore /outfile=corv(ruralcorv). * Activate file of output from regression. dataset activate ruralcorv. * Drop all rows of output except the coefficients. select if (rowtype_ = 'EST'). execute. * Delete unnecessary variables before merging. delete variables DEPVAR_ VARNAME_. * Rename variables containing the constant and the coefficient. rename variables CONST_=rurconst rurscore=rurcoeff. * Re-activate the main household data. dataset activate assets. * merge the coefficients. match files /file = * /table = ruralcorv /by ROWTYPE_. execute. dataset close urbancorv. dataset close ruralcorv. dataset activate assets. filter off. *** Calculate combined wealth score from Urban and Rural Scores. * Use coefficients from urban and rural regressions above. compute combscor=0. print formats combscor (f11.5). write formats combscor (f11.5). ** Urban. if (urban = 1) combscor=urbconst+urbcoeff*urbscore. ** Rural. if (rural = 1) combscor=rurconst+rurcoeff*rurscore. variable labels combscor 'Combined national wealth score'. execute. compute hhwt = QHWEIGHT/1000000. variable labels hhwt 'HH weights'. formats hhwt (f12.6). weight by hhwt. filter off. execute. frequencies variables=combscor comscore /format=notable /ntiles=5 /statistics=minimum maximum stddev mean /histogram normal /order=analysis. filter off. filter by urban. execute. frequencies variables=combscor urbscore /format=notable /ntiles=5 /statistics=minimum maximum stddev mean /histogram normal /order=analysis. filter off. filter by rural. execute. frequencies variables=combscor rurscore /format=notable /ntiles=5 /statistics=minimum maximum stddev mean /histogram normal /order=analysis. filter off. execute. *Calculate quintiles and scores for data file. compute hhmemwt=QHWEIGHT*hhusual/1000000. variable labels hhmemwt 'HH members weighting for index'. formats hhmemwt (f12.6). weight by hhmemwt. filter off. filter by urban. execute. rank variables=urbscore (A) /rank /ntiles (5) /print=yes /ties=mean. filter off. filter by rural. execute. rank variables=rurscore (A) /rank /ntiles (5) /print=yes /ties=mean. filter off. execute. rank variables=combscor (A) /rank /ntiles (5) /print=yes /ties=mean. variable labels ncombsco 'Combined wealth index' /nurbscor 'Urban wealth index' /nrurscor 'Rural wealth index'. value labels ncombsco nurbscor nrurscor 1 'Lowest' 2 'Second' 3 'Middle' 4 'Fourth' 5 'Highest'. *** Check on quintiles. frequencies variables=ncombsco nurbscor nrurscor. weight by hhwt. ctables /table ( QH201_1+QH201_2+QH201_3+QH201_4+QH201_6+QH202+ QH203_11+QH203_12+QH203_13+QH203_21+QH203_31+QH203_32+QH203_41+QH203_42+QH203_61+QH203_81+QH203_91+QH203_96+ QH208_1+QH208_2+QH208_3+QH208_6+ QH208_1_sh+QH208_2_sh+QH208_3_sh+ QH210_11+QH210_13+QH210_14+QH210_21+QH210_22+QH210_23+QH210_31+QH210_33+QH210_34+QH210_35+QH210_40+QH210_41+QH210_96+ QH214_11+QH214_21+QH214_31+QH214_32+QH214_34+QH214_35+QH214_36+QH214_37+QH214_38+QH214_96+ QH215A+QH215B+QH215C+QH215D+QH215E+QH215F+QH215G+QH215H+QH215I+QH215J+QH215K+QH215L+QH215M+QH215N+QH215O+QH215P+QH215Q+QH215R+QH215S+QH215T+QH215U+QH215V+ QH215W+QH216+QH218_1+QH218_2+QH218_3+QH218_4+QH218_5+QH218_96+ NOTOILET+DOMESTIC+LAND+memsleep+ )[S][Mean F8.3] by (ncombsco+nurbscor+nrurscor)[C] /slabels visible=no. * Alternative instead of ctables. *means tables= QH201_1 QH201_2 QH201_3 QH201_4 QH201_6 QH202 QH203_11 QH203_12 QH203_13 QH203_21 QH203_31 QH203_32 QH203_41 QH203_42 QH203_61 QH203_81 QH203_91 QH203_96 QH208_1 QH208_2 QH208_3 QH208_6 QH208_1_sh QH208_2_sh QH208_3_sh QH210_11 QH210_13 QH210_14 QH210_21 QH210_22 QH210_23 QH210_31 QH210_33 QH210_34 QH210_35 QH210_40 QH210_41 QH210_96 QH214_11 QH214_21 QH214_31 QH214_32 QH214_34 QH214_35 QH214_36 QH214_37 QH214_38 QH214_96 QH215A QH215B QH215C QH215D QH215E QH215F QH215G QH215H QH215I QH215J QH215K QH215L QH215M QH215N QH215O QH215P QH215Q QH215R QH215S QH215T QH215U QH215V QH215W QH216 QH218_1 QH218_2 QH218_3 QH218_4 QH218_5 QH218_96 NOTOILET DOMESTIC LAND memsleep by ncombsco nurbscor nrurscor /cells mean count stddev. graph /histogram(normal)=combscor /title= 'Distribution of Households by Wealth Scores'. frequencies variables=combscor /format=notable /ntiles=5 /statistics=stddev minimum maximum semean mean median mode skewness seskew kurtosis sekurt /order=analysis. weight off. filter off. write formats combscor urbscore rurscore (f11.5). * Save final dataset of assets. save outfile='assets.sav'. *** Write out scores file. write outfile='scores.dat' table /QHCLUST QHNUMBER combscor ncombsco urbscore nurbscor rurscore nrurscor. execute. * Produce table 2.6 weighted by de jure population to test. weight by hhmemwt. compute total = 0. variable labels total 'Total'. value labels total 0 ' '. ctables /vlabels variables=QHTYPE QHREGION total Ncombsco display=both /table QHTYPE [C] + QHREGION [C] + total [C] BY Ncombsco [C][rowpct.count '%' F8.1, totals [rowpct.count '%' F8.1, count '' F8.0]] /categories variables=Ncombsco total=yes /titles title='Table 2.6 Wealth Quintiles' '' 'Percent distribution of the de jure population by wealth quintiles, according to residence and region, Turkey DHS 2018 ' corner='Residence/region' /slabels visible=no.